package com.aspose.cells;

import java.util.Iterator;

class zbe extends zbz {
   private zbz[] a;

   zbe() {
      this.c(2174);
   }

   void a(zqa var1) throws Exception {
      super.a(var1);
      if (this.a != null) {
         zbz[] var2 = this.a;
         int var3 = var2.length;

         for(int var4 = 0; var4 < var3; ++var4) {
            zbz var5 = var2[var4];
            var5.a(var1);
         }
      }

   }

   void a(FilterColumn var1) {
      this.a = null;
      MultipleFilterCollection var2 = (MultipleFilterCollection)var1.getFilter();
      this.b(60);
      this.c = new byte[this.d()];
      int var3 = this.b(var1);
      this.c[var3] = (byte)var1.getFieldIndex();
      var3 += 2;
      if (var1.a()) {
         this.c[var3] = 1;
      }

      var3 += 4;
      var3 += 8;
      int var4 = var2.getCount();
      int var5 = 0;
      Iterator var6 = var2.iterator();

      while(var6.hasNext()) {
         Object var7 = var6.next();
         if (var7 instanceof DateTimeGroupItem) {
            ++var5;
         }
      }

      var4 -= var5;
      if (var2.getMatchBlank()) {
         ++var4;
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a(var4), 0, this.c, var3, 4);
      var3 += 4;
      System.arraycopy(com.aspose.cells.b.a.zc.a(var5), 0, this.c, var3, 4);
      var3 += 4;
      AutoFilter var12 = var1.c().a();
      if (var12.a == null || var12.a instanceof Worksheet) {
         this.c[var3] = 8;
      }

      ++var3;
      var3 += 5;
      int var13 = -1;
      if (var12.a != null && var12.a instanceof ListObject) {
         var13 = ((ListObject)var12.a).a();
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a(var13), 0, this.c, var3, 4);
      this.a = new zbz[var4 + var5];
      int var8 = 0;
      Iterator var9 = var2.iterator();

      Object var10;
      zmn var11;
      while(var9.hasNext()) {
         var10 = var9.next();
         if (!(var10 instanceof DateTimeGroupItem)) {
            var11 = new zmn();
            var11.a(var1, var10);
            this.a[var8++] = var11;
         }
      }

      if (var2.getMatchBlank()) {
         zmn var14 = new zmn();
         var14.a(var1);
         this.a[var8++] = var14;
      }

      var9 = var2.iterator();

      while(var9.hasNext()) {
         var10 = var9.next();
         if (var10 instanceof DateTimeGroupItem) {
            var11 = new zmn();
            var11.a(var1, (DateTimeGroupItem)var10);
            this.a[var8++] = var11;
         }
      }

   }

   private int b(FilterColumn var1) {
      this.c[0] = 126;
      this.c[1] = 8;
      this.c[2] = 1;
      CellArea var2 = var1.c().a().h();
      System.arraycopy(com.aspose.cells.b.a.zc.a(var2.StartRow), 0, this.c, 4, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var2.EndRow), 0, this.c, 6, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var2.StartColumn), 0, this.c, 8, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var2.EndColumn), 0, this.c, 10, 2);
      return 12;
   }
}
